package com.naton.common.bean;

/**
 * @time: 2022/1/19
 * @author: lifuling
 * @version: v1.0
 * @file_desc: 分页加载数据
 */
public class PageInfo {

    //其实也  默认从第一页开始
    private int pageIndex = 1;
    private String pageSize = "20";

    /**
     * 获取也一页的页码
     * @return
     */
    public int nextPage(){
        return pageIndex++;
    }

    /**
     * 是否为首页
     * @return
     */
    public boolean isFirstPage(){
        return pageIndex == 0;
    }

    /**
     * 重置页码
     */
    public void resetPageIndex(){
        pageIndex = 1;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public String getPageSize() {
        return pageSize;
    }

    public void setPageSize(String pageSize) {
        this.pageSize = pageSize;
    }
}
